package model

import (
	"gorm.io/gorm"
	"time"
)

type BaseModel struct {
	OrderBy     string         `json:"orderBy" gorm:"column:orderBy"`
	CreatedTime time.Time      `gorm:"column:create_time;autoCreateTime" json:"-"`
	UpdatedTime time.Time      `gorm:"column:last_updated_time;autoUpdateTime" json:"-"`   // 自动设置
	DeletedAt   gorm.DeletedAt `gorm:"index;column:deleted_at" json:"deletedAt,omitempty"` // 软删除支持
	CreateBy    string         `gorm:"column:create_by" json:"createBy"`
	UpdateBy    string         `gorm:"column:update_by" json:"updateBy"`
	Version     int            `gorm:"column:version;default:1" json:"version"`
}

type PageResult struct {
	PageSize int   `json:"pageSize"`
	PageNum  int   `json:"pageNum"`
	Total    int64 `json:"total"`
}
